//
//  XPhotoBrowser.h
//  XPhotoLibraryKit
//
//  Created by Wu,Xinting on 2018/3/21.
//

#import <UIKit/UIKit.h>

@class XPhotoBrowser, XPhoto;
@protocol XPhotoBrowserDataSource <NSObject>

@required
- (NSUInteger)numberOfPhotosInPhotoBrowser:(XPhotoBrowser *)browser;
- (XPhoto *)photoBrowser:(XPhotoBrowser *)browser photoForIndex:(NSUInteger)index;

@end

@protocol XPhotoBrowserDelegate <NSObject>

@optional
- (void)photoBrowser:(XPhotoBrowser *)browser displayItemAtIndex:(NSUInteger)index;

@end

@interface XPhotoBrowser : UICollectionView

@property (nonatomic, assign) NSUInteger currentIndex;
@property (nonatomic, weak) id<XPhotoBrowserDataSource> browserDataSource;
@property (nonatomic, weak) id<XPhotoBrowserDelegate> browserDelegate;
@property (nonatomic, readonly) CGRect sourceRect;
@property (nonatomic, readonly) CGRect targetRect;

- (void)animationSourceView:(UIView *)sourceView;
- (void)animationTargetView:(UIView *)targetView;

@end
